<script lang="ts" setup>
// #region 引入包, 函数和组件
import { ref } from 'vue'
import Login from './components/LoginLogic.vue' // 登录逻辑
import Regist from './components/RegistLogic.vue' // 登录逻辑
// #endregion

// #region // 使用模块(仓库、路由、父组件参数函数)

// #endregion

// #region // 变量
const showLogin = ref(true) // 显示登录组件
// #endregion

// #region // 函数
const changeShowLogin = () => (showLogin.value = !showLogin.value)

// #region // 生命周期和vue函数

// #endregion
</script>

<template>
  <div class="login">
    <div class="box">
      <Login v-if="showLogin" @change="changeShowLogin"></Login>
      <Regist v-else @change="changeShowLogin"></Regist>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.login {
  width: 100%;
  height: 100%;
  background: url('https://img.alicdn.com/tfs/TB1cpTewMHqK1RjSZFEXXcGMXXa-2872-1580.png') no-repeat;
  background-size: cover;
  display: flex;
  .box {
    margin: auto;
    width: 400px;
    min-height: 400px;
    padding: 40px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 3px 3px 5px rgba($color: #000000, $alpha: 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
}
</style>
